class Notice {
  final int? id;
  final String? title;
  final String? imageUrl;
  final String? content;
  final String? publisher;
  final String? publishTime; // 如果后端返回字符串格式日期，建议保留为 String
  final String? status;
  final String? createBy;
  final String? createTime;
  final String? updateBy;
  final String? updateTime;
  final String? remark;

  Notice({
    this.id,
    this.title,
    this.imageUrl,
    this.content,
    this.publisher,
    this.publishTime,
    this.status,
    this.createBy,
    this.createTime,
    this.updateBy,
    this.updateTime,
    this.remark,
  });

  factory Notice.fromJson(Map<String, dynamic> json) {
    return Notice(
      id: json['id'],
      title: json['title'],
      imageUrl: json['imageUrl'],
      content: json['content'],
      publisher: json['publisher'],
      publishTime: json['publishTime'],
      status: json['status'],
      createBy: json['createBy'],
      createTime: json['createTime'],
      updateBy: json['updateBy'],
      updateTime: json['updateTime'],
      remark: json['remark'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'title': title,
      'imageUrl': imageUrl,
      'content': content,
      'publisher': publisher,
      'publishTime': publishTime,
      'status': status,
      'createBy': createBy,
      'createTime': createTime,
      'updateBy': updateBy,
      'updateTime': updateTime,
      'remark': remark,
    };
  }
}
